package org.example.order.api;

import org.example.core.constant.TokenConstants;
import org.example.core.utils.R;
import org.example.order.api.module.Order;
import org.example.order.api.module.OrderItem;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 小杰_cc
 * @version 1.0
 */
@FeignClient("cart-service")
public interface CartService {

    // 获取购物车选中的商品
    @GetMapping("/cart/front/selected")
    R<List<OrderItem>> selected(@RequestHeader(TokenConstants.MEMBER_ID) String memberId);

    // 根据skuId集合获取商品
    @PostMapping("/cart/front/order/item")
    R<List<OrderItem>> orderItem(@RequestBody List<Long> ids, @RequestHeader(TokenConstants.MEMBER_ID) String memberId);

    // 删除购物车对应数据
    @DeleteMapping("/cart/front/deletes")
    R<?> deletes(@RequestBody List<Long> skuIds, @RequestHeader(TokenConstants.MEMBER_ID) String memberId);
}